/*
 *  $Id: LifeTree.cs 1051 2010-05-18 22:10:41Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Earth.Lands {
    public class LifeTree: LandCard {
        public LifeTree(): base("001_e_l_life_tree") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Earth;
            Value = 100;
            AddManaCost(ElementType.Earth, 2);
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add(new Affects.ManaIncome(ElementType.Earth, 2));
            affects.Add<LifeTreeAura>();
		}

        private class LifeTreeAura: CreatureAuraAffect {
            public LifeTreeAura(): base(true, true) {}

            public override string Id {
                get { return AffectManager.GetCardId<LifeTree>("aura"); }
            }

            public override int AverageWeightPercent {
                get { return 500; }
            }

            protected override bool AcceptCreature(Creature cr) {
                return cr.Card.Element == ElementType.Earth;
            }

            protected override Affect CreateSubAffect() {
                return new LifeTreeAffect();
            }
        }

        private class LifeTreeAffect: SpellAffect<LifeTree> {
            public LifeTreeAffect() {
                Add(new Affects.Regeneration(1));
            }
        }
    }
}
